package com.gcxy.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * <p>
 * 
 * </p>
 *
 * @author jiang
 * @since 2023-12-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AccountInfo对象", description="")
public class AccountInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "account", type = IdType.ASSIGN_ID)
//    @Length(min = 5,max = 11,message = "账号长度为5-11")
//    @Pattern(regexp = "^[A-Za-z0-9]+$",message = "账号只能是数字和字母")
    private String account;

    @NotNull(message = "用户名不能为空")
    private String accName;

//    @NotNull(message = "密码不能为空")
//    @Length(min = 6,max = 20,message = "密码长度为6-20")
//    @Pattern(regexp = "^[A-Za-z0-9]+$",message = "密码只能是数字和字母")
    private String password;

    @NotNull(message = "电话不能为空")
    @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[0135678])|(18[1-9]))\\d{8}$", message = "手机号格式错误")
    private String accPhone;

    @ApiModelProperty(value = "是否启用(1:启用，0:停用)")
    private Integer isEnable;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


}
